fix(hillshade): revert per-tile blend, use isolation: isolate on #map (#171)#172
fix(hillshade): revert per-tile blend, use isolation: isolate on #map (#171)#172jasoneplumb merged 2 commits intomainlinefrom
Conversation
… instead PR #169 moved mix-blend-mode from .hillshade-blend (the layer container) to .hillshade-blend img.leaflet-tile (individual tile images). I had the stacking-context reasoning backwards: applying the blend AT the tile image places it INSIDE the transformed .leaflet-tile-container's stacking context. That context contains only the hillshade tiles — nothing to multiply against — so the blend has no backdrop and renders source pixels opaque, hiding the base map entirely. Correct placement is at .hillshade-blend, which is a peer of the base-layer container under .leaflet-tile-pane. There the multiply blend has the base map as the sibling backdrop. To address the original "sometimes not applied" symptom from #168, add isolation: isolate to #map. This makes the map a clean stacking- context root so the blend can reliably composite against base-layer tiles without ancestor compositing layers isolating it from the intended backdrop. Closes #171 Re-opens #168 conceptually but the new fix targets the actual root cause. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code ReviewOverviewThis is a focused, correct CSS fix: reverts What's working well
IssuesComment style violates CLAUDE.md conventionsCLAUDE.md says:
Both new comments are multi-line blocks, and the second one explicitly references "PR #169", which will be meaningless context once this merges and time passes. The PR description already carries this history — the code comments should be trimmed to just the non-obvious WHY. Suggested replacements: /* isolation: isolate keeps mix-blend-mode contained to the map's own stacking context */
#map { position: absolute; top: 0; bottom: 0; right: 0; left: 0; isolation: isolate; }
/* blend at container level so .hillshade-blend composites against the base-layer sibling below it */
.hillshade-blend { mix-blend-mode: multiply; }That's one short line each — captures the non-obvious WHY without the implementation history. Manual test plan is incompleteThree of the five manual test steps remain unchecked. These cover the core scenarios (hillshade visible without blocking basemap, no dropouts at max zoom, basemap switching). The fix should be manually verified before merge, especially since the previous regression (#171) was a visual failure that escaped without a browser test. Minor / Non-blocking
SummaryThe fix is technically correct and well-motivated. Two things before merging:
🤖 Generated with Claude Code |
Single-line comments capturing only the non-obvious WHY; no PR refs that rot as the codebase evolves. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review — PR #172OverviewA minimal, targeted CSS-only fix (4 additions / 3 deletions) for the hillshade blend regression introduced in #169. Reverts Correctness ✅The CSS stacking-context reasoning is sound:
Code Quality ✅
Minor Observations
Test PlanThe manual test checklist in the PR description is appropriate for a visual CSS change — automated unit tests can't cover blend-mode rendering. Suggested additions to the checklist:
SummaryThis is a clean, well-reasoned fix. The PR description's stacking-context explanation is excellent — it makes the intent auditable in the future. Ready to merge once the manual rendering checks pass. 🤖 Generated with Claude Code |
Summary
Fix
Closes #171.
Why this is the right level
`isolation: isolate` on the map root creates a self-contained stacking context. Inside it, every Leaflet pane and layer composites against the map's backdrop, so `mix-blend-mode` on `.hillshade-blend` has a stable, predictable backdrop (the base layer below it in the tile pane).
Test plan
🤖 Generated with Claude Code